<!DOCTYPE html>
<html>
<head>
	<title>新手体验标</title>
	<meta charset="utf-8">
	<meta name = "viewport" content ="initial-scale=1.0,maximum-scale=1,user-scalable=no">
	<meta content="yes" name="apple-mobile-web-app-capable">
	<meta content="telephone=no" name="format-detection">
	<link rel="stylesheet" type="text/css" href="/resource/web/css/reset.css">
	<link rel="stylesheet" type="text/css" href="/resource/web/css/flex.css">
	<link rel="stylesheet" type="text/css" href="/resource/web/css/finacing.css">
	<script type="text/javascript" src="/resource/web/js/flexible.js"></script>
    <script type="text/javascript" src="/resource/web/js/jquery-1.11.1.min.js"></script>
</head>
<?php
	$user_info = session_get(UserEnum::USER_INFO_SESSION_KEY);
?>
<body>
    <div class="title">
    	<p>体验标</p>
		<input type="hidden" value="{{$tiyan->auto_id}}" id="auto_id">
		<input type="hidden" value="{{$tiyan->exper_amount}}" id="exper_amount">
		@if(!empty($user_info))
			<input type="hidden" value="{{$user_info->user_id}}" id="user_id">
		@endif
    	<a href="/Web/index"><img class="back" src="/resource/web/img/newhead/path_7_copy.png"></a>
    	<a href="#0"><img class="share" src="/resource/web/img/finacing/share.png"></a>
    </div>
    <div class="fin-show">
    	<ul class="fs-ul tcf-flex tcf-justify-center tcf-align-items-end">
    		<li class="firli">
    			<p><span>{{$tiyan->expect_rate}}</span>%</p>
    			<p><img src="/resource/web/img/finacing/nh-shouyi.png">预期年化收益</p>
    		</li>
    		<li class="secli">
    			<p><span>{{$tiyan->deadline}}</span>天</p>
    			<p><img src="/resource/web/img/finacing/nh-qixian.png">投资期限</p>
    		</li>
    	</ul>
    </div>
    <div class="fin-show2">
    	<ul class="fs-ul2 tcf-flex tcf-justify-center tcf-justify-justify">
    		<li>
    			<p>融资金额 <span>999,900元</span></p>
    			<p>剩余金额
					<span>
						@if(!empty($all_amount))
							{{number_format(999900-$all_amount)}}元
						@else
							999,900元
						@endif
					</span>
				</p>
    		</li>
    		<li>
    			<p>发布时间 <span>{{date('Y-m-d',time())}}   10:00</span></p>
    			<p>截止时间 <span>{{date('Y-m-d',time()+86400)}}   00:00</span></p>
    		</li>
    	</ul>
    </div>
    <div class="fin-cont">
    	<p>体验金金额</p>
    	<p class="fc-img">&nbsp&nbsp<span>6666</span>元</p>
    	{{--<a href="#0"><div class="fc-tiyan-btn">立即体验</div></a>--}}
		@if(empty($user_invest_record))
			<a href="#0" ><div class="fc-tiyan-btn">立即体验</div></a>
		@else
			<div class="fn-rbtn-end">已投资</div>
		@endif
    </div>
    <div class="line"></div>
    <div class="instruction">
    	<p>体验标说明</p>
    	<ul>
    		<li>1、体验标无需实名认证即可投资此项目。</li>
    		<li>2、体验标是由平台设立的一个提供给用户进行体验的资金，只能投资
体验标项目，使用后即可产生可用收益。</li>
    		<li>3、注册新用户即可获得6666元的体验金，获得后即可在此体验标投资。</li>
    		<li>4、投资完成后，本金将由平台收回。投资获得的收益归用户所有，可
直接提现。</li>
    		<li>5、本项目最终解释权归钢票网平台所有，若有其他疑问，请联系客服咨询 4000-678-797</li>
    	</ul>
    </div>
    <!-- 弹窗 -->
    <div class="mod-tanchu" style="display: none">
        <div class="mt-cont">
            <img class="cimg" src="/resource/web/img/account/cimg.png">
            <p class="pfir">投资金额<span>6666元</span></p>
            <p>投资期限<span>1天</span></p>
            <p>预计收益<span class="tc-num">1.83<span>元</span></span></p>
            <div class="tyb-btn" id="invest">确认投资</div>
        </div>
    </div>
<script type="text/javascript">
    $(".cimg").click(function() {
        $(".mod-tanchu").css("display","none");
    });
</script>
	<script>
	$(".fc-tiyan-btn").click(function(){
		$('.mod-tanchu').css('display','block')
	})

		$('#invest').click(function(){
			var exper_id = $('#auto_id').val();
			var user_id = $('#user_id').val();
			var exper_amount = $('#exper_amount').val();

			if(user_id){
				$.ajax({
					data:'exper_id='+exper_id+'&&user_id='+user_id+'&&exper_amount='+exper_amount,
					url:'/exper_invest',
					type:'post',
					success:function(msg){
						if(msg==4){
							alert('还没到时间');
						}else{
							if(msg==1){
//							alert('恭喜，投资成功,请于次日零点查看账户余额');
								location ="/Web/exper_success.html";
//							location ="/tiyan/"+exper_id+".html";
							}else if(msg==2){
								alert('您已经投资过了')
							}else if(msg==3){
								alert('已经下标')
							}
						}
					}
				});

			}else{
				alert('请先登录');
				location ="/Web/weblogin.html";
			}

		})
	</script>
</body>
</html>